package com.paschino.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.paschino.dao.NewsDAO;
import com.paschino.modal.News;

@Service
@Transactional
public class NewsServiceImpl implements NewsService {

	@Autowired
	private NewsDAO newsDAO;

	@Override
	public boolean addNews(News news) {
		return newsDAO.addNews(news);
	}

	@Override
	public List<News> getNewsList() {
		return newsDAO.getNewsList();
	}

	@Override
	public News getNews(int newsId) {
		return newsDAO.getNews(newsId);
	}

	@Override
	public boolean updateNews(News news) {
		return newsDAO.updateNews(news);
	}
	
	@Override
	public List<News> getTopNewsHomePage(){
		return newsDAO.getTopNewsHomePage();
	}
	
	@Override
	public List<News> getNewsListHomePage(){
		return newsDAO.getNewsListHomePage();
	}
	
	@Override
	public int deleteNews(int newsID) {
		return newsDAO.deleteNews(newsID);
	}
	
	@Override
	public int hideNews(int newsID) {
		return newsDAO.hideNews(newsID);
	}
	
	@Override
	public int unhideNews(int newsID) {
		return newsDAO.unhideNews(newsID);
	}
	
}
